changing return code of closeSession