dispathcer exit, not working properly