fix doubled code