added some error handling

user friendly? idk trivial shit