Added checks for capacity