fixed error regarding flash as undefined method