changing from function to typecast because function works only on php v5.5 and up