add setCapacity method for Queue