code cleanup, added try catch for user_self