Fix for handling mongoose