when i use
if [[ "$line" = "END"* ]]; then
it works? i guess the newline character is being sent to the terminal?