Fix bash if logic