avoid unchecked class cast