Switched check for current category position to avoid getId() on non-object error