added space detection