database working with simple model