added type column to user, minor changes here and there