few tweaks to make it work