finally works properly!