correct implementation of pop command to account for the presence of a message