added checkstate to deviceready