remove useless code and fix the syntax