check size before trying to use