feature exit and die function