saving userid properly