hopefully a fix for the strange ClassCastException