implemented sys_exit