fix variable assignment error