You haven't replace this with clearCurrentDocument yet. Sory, I should have indicated this as a second instance in my previous comment so that you don't miss.