Fixed Before_validaiton so that the code doesn't regenerate everytime and added attrib acces