Remember to check res against nil? before trying kind_of?