Variable scope fixed