use javascript console instead of alerts (fix)