add input check and finish fontend