Fixed a bug in datalayer