move lang to input, fixed exception handler