corrected var assignment