added custom errors and all tests