Added support to prevent directory toggling