try mongoose middleware