Fixed error when you do logout
Added additional check to edit mailbox items