Changed database update to work with hash