properly grab input values, also improved text selection