added foreign keys validations
fixed jquery reference