change from bool to logical