exiting phantom on error with all the other closing actions