updating database code