added error handling
Version 0.1.1