fixed 500 thrown when the method on the repository uses getSingleResult