fixed some of the error handling in the object