rm debug function
fix bug with incorrect output