Fixed error with accessing mongoose models