Added @geNAzt's patch