final fixes, still cant fix the bug