fixed empty table test
fixed out of bounds