add frontend validation