Reviewed and Fixed handle_line in select