Memory overflow error fixed