added JS validation