now it works correctly