improve logging and running on device