added try and catch block for invite user class mail logic