Started doing proper error handling