The correlation of critical currents and magnetization inYBa2Cu3O7