clear function and hide panel