new fresh code, added logging, still not working