form change function bug fix