works properly now