refactor send_if_exists to isExist + take the function out