bugs removed
validate functionality added