added code to onCreate method