fix debug error when user_id is null
fix notice issues, move js to script tag