Customised error handling
Added significantly more functionality