Fixed problem where the refile hook was being called after a message was