Updated code to reflect changes to db in b6d23bc0e1730338dba51d60be6058d22a3a0754