changed my mind about creating modular prevent default function