some bug fixes pulling from mongo