fixed #336 and flash undefined/false response