fixed type casting, current error is MORE confusing