Some small changes. Now works with onNewIntent