adding trim to getValue function