Modified getVersion function