slight modification on edge case