Add the action parameter
Use global variable ide to decide if we want to use app or global mode