fixed check for empty value of x
modified alert to self.alert