updated database handling to use data.execute