cast properly