check for null cursor
check for key != null