Added error handling for adding friends