fixing conditional at the end of the script