Added in function to throw error message if input is empty on click or enter