fix downcasting