avoid cast exception