Added check to see if there is enough space