add line to history only if line was given