Corrected return type of add function