Fixed flag checking for submit disabling