Adding deviceready function

Adding deviceready function