add better empty check