added some error handling, awjizz