Pathetic error handling added