fixed bug to make complete button always work