Final changes , I had to fix more stuff to get it working