detect not working, trying to debug