set path conditionally