These are the changes necessary to make it work reliably