fix based on gideon's comments