small changes so that they work fine in all php versions