Added check on input before checking if input.admin exists to avoid node.js cannot read property error