Fixed ruby script