fixed sign function