changed to some error handling