fixes main script