handle mongoose errors