changed method name
fixed error handling