fixed some issues with plan