modified clicktale code (only production)