Bug Fix

Corrected a typo in a SQL query that was causing internal server errors.