worked on adding the restriction to getmessages