added methods to dismiss keyboard when background is touched