avoid unsafe cast