added replace and findOne methods