fixes for race conditions for apk version.

hate it. hate it. hate it.