Fixed Bug in named query.