fix table key error
adding a test