bugfix in zshrc
add some conditional checks