Added 'On' and 'Off' button functionality in detailVC