Fix minor bug because of stupid end being forgotten in a method