added join table and fixed controllers