added check for empty variable