optimise modal close on mobile