added javascript validation
added flush to product