fixed some crashes when pinning emails