fixed function, now returns boolean