Fixed incorrect order of calls
Fixed dependencies