Finish diagram function
Fix bug on diagram controller