and few tweaks to stop stack errors