Fixes. Will transfer it to rails app.