add function to add view