Fixing the add function