fix variable count