fixed ruby script