updating the model to work with postgresql