added accept logic