fixed wrong usage of unset()