change cost message into the database