fixing shell bug, incorrect if block