bugfix (don't assume var is set)