Move monitor-enter outside try block