fixed add_source interface function