leave application n database