fixed typo
moved error declarations into seperate files