Got a solution ( Might be not good, but still ).
For anyone else wondering -> loop through Classes and check the class race (I'm making sure it's not a dummy class which will give you null pointer and also i'm looping only through 3rd classes). Check if found class is not the same race as current active and then change it to this temp. one. And yeah, if the server is kind of slow you will see the multiple template change but still it's a workaround.
If anyone has better solution PM ME. This topic can be closed. (If this post is a "spam" you can delete it easily - sorry for that).