variable masking bug in bash