fixed apply button bug