Condition not working properly when editing a submission