Added the end method to view