fixed control to check when page must be edited instead of added, added new test to verify this condition, refactored test