simplify
add flock in clear to be safe