changed type of checking: used -n operator instead of -z