made validate input directive dynamic