work on how the cost attribute saves and is retrieved from the database