properly ignore directories