frontend validation