moved from if-then-fi to case-esac