fix boolean flag handling