fixed error in query
removed unnecessary column from database and made appropriate changes to code