added goal detection