fix #27 only open modal when needed