Prevent preview button from going to homepage in case of js errors.