fixing cast