rescue from user not found error
some fixes and style improvements;