fixes variable errors