fixed bugs with optional dialog dependency and getting the action from either the dialog of the url state