fix cookie retrieval and dequeuing/sending message for cpe