fixing variable assignment