Fixed crash bug. Forgot to update part of a SQL query.