added input checking and success notification