cast bugfix