Added mongoose error handling