code for troubleshooting