revise script to find the correct app name