changed sql query to allow for approved and unapproved, final submission