Adding console logging to help debugging; still not working