added case for space char and default