Added necessary logic