implemented preventDefault feature