removing undefined properties