small features added and improve stability