make appstate work for applications named other then myapp