Added checking of emptiness