wrap all into a clousure to avoid collision problems