attempt 2 at fixing OOB bug