bug fixes for multi-user case