code cleanup, add delay for unread message notification