fixed bugs added flash stuff