findByOne error detection fixed