adds a .nil? check as well