Added better empty check