added a basic error handling :)