add the logic in hasemptybox and add method