Fixed a bug in data handler