tweaked directive to accomodate different form input types