removed global state and fixed clear area