if((int)Serial.read()==(int)str){
There are so many problems with this one statement...
str is a character array, containing "OK". How can you possibly cast that to an int?
Serial.read() reads ONE byte. That might be 'O'. It might be 'K'. Or, because you haven't made sure that there is actually anything to read, it might return -1. In any case, (-1, 'O', or 'K', or something other SINGLE character), it is impossible for that to equal "OK", no matter how you plead with the compiler to make it so.