Fixing

Some error handling