Included functioning script in views, and added trigger to team models