Added direction handler