fix block scoping issue