Corrected bash script