Removing erroneous end statement