added lame error handling