updated logic in save method for move model class