fixed scoping again