added element scoping to two places that were missing it