device script fixed