interim commit - added better handling of flash