added exiting behaviour
complete fix