made sure things are valid