a bug in the variable assignation fixed