added ai file and modified input validation