It was working fine as i tried the first version ... but this is giving me errors