Fixed cast exception