Add form code and fix search issue