now works properly