revert to old school way of checking if directory or not