Unable to repeat click event

This is basically a menu toggle feature which I want to repeat but doesn't unless I refresh the page. Clicking on (.fa-bars) adds class (.animate) to body which slides in the menu from the left, when the menu is visible clicking anywhere outside the menu area hides the menu as well as removes the class(.animate) from body.

This only works once then I have to refresh the page to make it work again, please suggest a way to fix this.