some crappy error hendling