move deviready function to index.html