input directive and some fixes