Currently the errors are a bit of a mess and sometimes raise errors due to not being called correctly. They should be restructured to fix them