replace the clear function with the delete document function
implemented move document