remove invalid stuff