add tests
fixed nil value returned