updated script, added check for argument