Prevent extra html data at end of export