did some error handling