added extension method for checking object is empty