Moved Suucess Exit to a function