Change assert to PlatformException to enable debug of ooiion-1327
fix exception check