got add function to work properly