Problem was with error handling