Improved commit hook