add check for behing and ahead