removed the exit(-1) part of the code