fixing user_id issue and adding tests

@calvinfo