getLDS(): query error checks

error checking code adapted from getBM()