Adding code for intents