Added tryEnter function and try catch in methods