add function is working now