add conditions for edge cases