changed if other operation to else if and handle else case