added flash function