Fixed a problem when findByKey returns NULL