Adding JS validation