Refixing database query.
Previous correction was incorrect, focused on wrong line.