Removed some log statements in getMessages function