udpated some problematic code