bug fixed -> exit() added