compatible for PHP version 5.4 below