casting a few wrong variables