Fixed flip bug