created delete fn to query with the database