add deviceready function