Updated to use NamedQuery rather than manual query