Storing steps in database