functional php : fix two isses