Modified application controller to monitor current user in background, also fixed signin and signout functionality